﻿@model YiYiTong.Rocket.Model.Manager.LoginReqModel

@{
    ViewBag.Title = "爱电子管理后台";
    Layout = "~/Views/Shared/_IndexLayout.cshtml";
}
<style>
    .notreadmsg a {
        color: red;
    }

    .big {
        font-size: large;
    }
</style>
<div class="header">

    <div class="dl-title">
        <!--<img src="/chinapost/Public/assets/img/top.png">-->
    </div>

    <div class="dl-log">
        欢迎您，<span class="dl-log-user">
            @if (Model != null)
            {
                @Model.loginName
            }
        </span>
        <info class="notreadmsg bui-menu" style="display:">
            
        </info>
        <a href="@Url.Action("LoginOut","User")" title="退出系统" class="dl-log-quit">[退出]</a>
    </div>
</div>
<div class="content">
    <div class="dl-main-nav">
        <div class="dl-inform"><div class="dl-inform-title"><s class="dl-inform-icon dl-up"></s></div></div>
        <ul id="J_Nav" class="nav-list ks-clear">
            @if (Model != null)
            {
                @Html.Raw(Model.TopStr)
            }
        </ul>
    </div>
    <ul id="J_NavContent" class="dl-tab-conten"></ul>
</div>
@if (Model != null)
{
    <script>
        var uid = '@Model.uid';
        BUI.use('common/main', function () {
            //加载左侧菜单
            $.post('@Url.Action("GetMenuConfig", "Home")', { UID: uid }, function (result) {
                var config = result;

                new PageUtil.MainPage({
                    modulesConfig: config
                });
            });
        });
    </script>
}

<script type="text/javascript">
    $(function () {
        $("#PhoneRoll").bootstrapNews({
            newsPerPage: 1,
            autoplay: true,
            pauseOnHover: true,
            navigation: false,
            direction: 'down',
            newsTickerInterval: 5000,
            onToDo: function () {
                //console.log(this);
            }
        });
    });
    function notice_msg() {
        window.open("/#21/75", "_top");
        location.reload();
    };
    function getMsgCount() {
        url = "@Url.Action("MsgCount", "BusinessMsg")";
        parameter = {};
        $.post(url, parameter, function (result) {
            if (result != null && result.Body != null) {
                var AllCount = result.Body.AllCount;
                var NewCounts = result.Body.AllCount;
                if (AllCount > 0) {
                    $('.notreadmsg').html('<a class="openbasetab" href="/BusinessMsg/MsgList">未读消息<info class="red big">【' + AllCount + '】</info></a>');
                    setopenbasetab();
                } else {
                    $('.notreadmsg').html("");
                }
                if (NewCounts > 0) {
                }
            };
        });
    }
    $(function () {
        setInterval(getMsgCount, 5000);
        setopenbasetab();
    });

    function setopenbasetab() {
        //打开内容
        $(".openbasetab").click(function (e) {
            e.preventDefault();
            var href = $(this).attr("href");
            if (top.topManager) {
                top.topManager.openPage({
                    href: href,
                    id:'20190418'
                });
            }
        });
    }


    function addVoice() {
        document.getElementById('audio').play();
    }
</script>
